import request from '@/utils/request'

export function listStorage(query) {
  return request({
    url: '/storage/list',
    method: 'get',
    params: query
  })
}

export function createStorage(data) {
  alert("s")
  return request({
    url: process.env.VUE_APP_BASE_API+'/storage/create',
    method: 'post',
    data
  })
}

export function readStorage(data) {
  return request({
    url: '/storage/read',
    method: 'get',
    data
  })
}

export function updateStorage(data) {
  return request({
    url: '/storage/update',
    method: 'post',
    data
  })
}

export function deleteStorage(data) {
  console.log("delete")
  return request({
    url: '/storage/delete',
    method: 'post',
    data
  })
}

export function deleteByName(url) {
  console.log(url)
  return request({
    url: '/storage/deleteByName?url='+url,
    method: 'get'
  })
}

const uploadPath = process.env.VUE_APP_BASE_API + '/storage/create'
const deletePath = process.env.VUE_APP_BASE_API + '/storage/delete'
export { uploadPath,deletePath }
